Conventionally, various information processing apparatus each of which allows a user to move or rotate a housing of an input device, and performs a processing in accordance with a movement of the housing, have been developed. For example, Japanese Laid-Open Patent Publication No. 6-50758 (hereinafter, referred to as Patent Document 1) discloses an information processing apparatus which uses a remote commander (input device) having a vibrating gyroscope (an angular velocity sensor) mounted therein so as to perform a processing.
The information processing apparatus disclosed in Patent Document 1 determines a direction in which a user moves the remote commander, based on an angular velocity obtained by the vibrating gyroscope, and executes a command in accordance with the determination result. Specifically, a voltage generated from a driving piezoelectric ceramic included in the vibrating gyroscope rises in accordance with an angular velocity obtained when a user moves the remote commander upward. On the other hand, a voltage generated from the driving piezoelectric ceramic drops in accordance with an angular velocity obtained when a user moves the remote commander downward. By using the remote commander having the vibrating gyroscope mounted therein as described above, the information processing apparatus determines that the remote commander is moved upward when the voltage rises up to a predetermined value, whereas the information processing apparatus determines that the remote commander is moved downward when the voltage drops to a predetermined value. The information processing apparatus moves a cursor in a display screen upward in accordance with a command to be executed in response to the remote commander being moved upward, whereas the information processing apparatus moves the cursor in the display screen downward in accordance with a command to be executed in response to the remote commander being moved downward.
However, the vibrating gyroscope (angular velocity sensor) mounted in the input device disclosed in Patent Document 1 costs more than an acceleration sensor and the like, which leads to increase in cost of the input device itself. On the other hand, when the vibrating gyroscope is simply replaced with an acceleration sensor so as to mount the acceleration sensor in the input device, and a value of data outputted by the acceleration sensor is used as it is, the gravitational acceleration applied to the input device may be included in the value, whereby an accurate determination becomes difficult. Further, when the input device is being moved in a predetermined direction, an acceleration may be applied to the input device in the direction opposite to the predetermined direction, or the acceleration may be variable depending on an operation performed by a user, or an acceleration may be influenced by an accuracy error of the device itself, for example. In these cases, accurate determination may become difficult.
Therefore, certain example embodiments provide a storage medium having stored thereon an information processing program and an information processing apparatus for realizing an accurate operation, in an inexpensive manner, by using data outputted by an acceleration sensor mounted in a predetermined housing.
The reference numerals, step numbers and the like in the parentheses indicate the correspondence with the embodiment described below in order to aid in understanding certain example embodiments and are not intended to limit, in any way, the scope of the present invention.
A first aspect of certain example embodiments is directed to a storage medium having stored thereon an information processing program executed by a computer (10) of an information processing apparatus (5) which performs a processing using acceleration data (accn) outputted by an acceleration sensor (701, 706) for detecting for an acceleration, in at least one axial direction, applied to a predetermined housing (70, 71, 76, 77) thereof. The information processing program causes the computer to function as: acceleration data acquisition means (step 43, the CPU 10 which executes step 103; hereinafter, only step numbers will be represented); accumulation vector calculation means (S48, S108); following vector calculation means (S49, S109); differential vector calculation means (S50, S110); and processing means (S51, S113). The acceleration data acquisition means repeatedly acquires the acceleration data. The accumulation vector calculation means calculates an accumulation vector (veca) by sequentially accumulating an acceleration vector having a magnitude and a direction of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means. The following vector calculation means calculates a following vector (vecg) which follows, at a predetermined rate (K), the accumulation vector calculated by the accumulation vector calculation means, by using the acceleration data acquired by the acceleration data acquisition means. The differential vector calculation means calculates, as a differential vector (vecd), a difference between the accumulation vector and the following vector. The processing means designates a position (pos) in a virtual world displayed by a display device (2) using a value (vecdX, vecdY, vecdZ, daX, daY, daZ) determined in accordance with the differential vector, and performs a predetermined processing by using the position.
In a second aspect based on the first aspect, the processing means designates the position, in the virtual world, corresponding to axial component values (vecdX, vecdY, vecdZ) of the differential vector, and performs the predetermined processing using the position.
In a third aspect based on the second aspect, the accumulation vector calculation means includes attenuation processing means (S47, S107). The attenuation processing means sequentially attenuates the accumulation vector before or after the acceleration vector is added to the accumulation vector.
In a fourth aspect based on the second aspect, when a magnitude of the differential vector calculated by the differential vector calculation means is larger than a predetermined threshold value, the processing means designates the position, in the virtual world, corresponding to the axial component values of the differential vector, and performs the predetermined processing by using the position.
In a fifth aspect based on the second aspect, the acceleration sensor is capable of detecting for the acceleration having the magnitude within a predetermined measurable range. The information processing program causes the computer to further function as change amount vector calculation means (S82, S86, S90) and estimated acceleration vector calculation means (S83, S84, S87, S88, S91, S92). The change amount vector calculation means calculates, by using the acceleration data acquired by the acceleration data acquisition means, a change amount vector (accv) representing a change amount of the acceleration, when the magnitude of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means has a value within the predetermined measurable range (Yes in S81, S85, S89). The estimated acceleration vector calculation means calculates, when the magnitude of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means has a value outside the predetermined measurable range (No in S81, s85, S89), an estimated acceleration vector (accn) by attenuating, by a predetermined amount, the change amount vector immediately preceding the change amount vector being currently calculated so as to update the change amount vector, and adding the updated change amount vector to the acceleration vector having been most recently used by the accumulation vector calculation means. The accumulation vector calculation means updates, when the magnitude of the acceleration vector having the magnitude and the direction of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means has a value outside the predetermined measurable range, the accumulation vector by adding the estimated acceleration vector to the accumulation vector.
In a sixth aspect based on the second aspect, the predetermined processing performed by the processing means is a process of positioning a predetermined object (OBJ) at the position having been designated in the virtual world, and moving the predetermined object in the virtual world in accordance with the position being moved.
In a seventh aspect based on the second aspect, the processing means designates the position by associating the axial component values of the differential vector with coordinate values of a coordinate system (xyz) defined in the virtual world, respectively. The processing means moves, in the virtual world, an originating point (reference position) of the coordinate system defined in the virtual world when a predetermined condition is satisfied.
In an eighth aspect based on the second aspect, the acceleration data acquisition means repeatedly acquires, when an input device (7) has a first housing and a second housing (71, 77), first acceleration data outputted by a first acceleration sensor mounted in the first housing, and second acceleration data outputted by a second acceleration sensor mounted in the second housing. The accumulation vector calculation means sequentially accumulates a first acceleration vector having a magnitude and a direction of an acceleration represented by the first acceleration data, so as to calculate a first accumulation vector, and sequentially accumulates a second acceleration vector having a magnitude and a direction of an acceleration represented by the second acceleration data, so as to calculate a second accumulation vector. The following vector calculation means calculates a first following vector which follows, at a predetermined rate, the first accumulation vector, by using the first acceleration data, and calculates a second following vector which follows, at a predetermined rate, the second accumulation vector, by using the second acceleration data. The differential vector calculation means calculates, as a first differential vector, a difference between the first accumulation vector and the first following vector, and calculates, as a second differential vector, a difference between the second accumulation vector and the second following vector. The processing means designates a first position by associating axial component values of the first differential vector with coordinate values of a first coordinate system defined in the virtual world, respectively, and designates a second position by associating axial component values of the second differential vector with coordinate values of a second coordinate system, respectively, which is different from the first coordinate system and defined in the virtual world. The predetermined processing performed by the processing means is a process of positioning a first object (OBJ1) at the first position and a second object (OBJ2) at the second position, and moving the first object and the second object in the virtual world in accordance with the first position and the second position being moved, respectively.
In a ninth aspect based on the first aspect, the information processing program causes the computer to further function as accumulation differential value calculation means (S112). The accumulation differential value calculation means calculates an accumulation differential value (da) by sequentially accumulating the differential vector calculated by the differential vector calculation means, in units of axial component values thereof. The processing means designates the position, in the virtual world, corresponding to the accumulation differential value (daX, daY, daZ) calculated by the accumulation differential value calculation means, and performs the predetermined processing using the position.
In a tenth aspect based on the ninth aspect, the accumulation vector calculation means includes attenuation processing means. The attenuation processing means sequentially attenuates the accumulation vector before or after the acceleration vector is added to the accumulation vector.
In an eleventh aspect based on the ninth aspect, the accumulation differential value calculation means calculates the accumulation differential value by sequentially accumulating the differential vector in units of the axial component values thereof when a magnitude of the differential vector calculated by the differential vector calculation means is larger than a predetermined threshold value.
In a twelfth aspect based on the ninth aspect, the acceleration sensor is capable of detecting for the acceleration having the magnitude within a predetermined measurable range. The information processing program causes the computer to further function as change amount vector calculation means and estimated acceleration vector calculation means. The change amount vector calculation means calculates, by using the acceleration data acquired by the acceleration data acquisition means, a change amount vector representing a change amount of the acceleration, when the magnitude of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means has a value within the predetermined measurable range. The estimated acceleration vector calculation means calculates, when the magnitude of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means has a value outside the predetermined measurable range, an estimated acceleration vector by attenuating, by a predetermined amount, the change amount vector immediately preceding the change amount vector being currently calculated so as to update the change amount vector, and adding the updated change amount vector to the acceleration vector having been most recently used by the accumulation vector calculation means. The accumulation vector calculation means updates, when the magnitude of the acceleration vector having the magnitude and the direction of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means has a value outside the predetermined measurable range, the accumulation vector by adding the estimated acceleration vector to the accumulation vector.
In a thirteenth aspect based on the ninth aspect, the predetermined processing performed by the processing means is a process of positioning a predetermined object at the position having been designated in the virtual world, and moving the predetermined object in the virtual world in accordance with the position being moved.
In a fourteenth aspect based on the ninth aspect, the predetermined housing includes at least one operation button (72) for outputting predetermined operation data in accordance with a user pressing the at least one operation button. The information processing program causes the computer to further function as operation data acquisition means (S111). The operation data acquisition means repeatedly acquires the operation data. The accumulation differential value calculation means sequentially accumulates the differential vector in units of the axial component values thereof only when the operation data indicating that a predetermined operation button among the at least one operation button is pressed is acquired.
A fifteenth aspect of certain example embodiments is directed to an information processing apparatus for performing a processing using acceleration data outputted by an acceleration sensor for detecting for an acceleration, in at least one axial direction, applied to a predetermined housing thereof. The information processing apparatus comprises: acceleration data acquisition means; accumulation vector calculation means; following vector calculation means; differential vector calculation means; and processing means. The acceleration data acquisition means repeatedly acquires the acceleration data. The accumulation vector calculation means calculates an accumulation vector by sequentially accumulating an acceleration vector having a magnitude and a direction of the acceleration represented by the acceleration data acquired by the acceleration data acquisition means. The following vector calculation means calculates a following vector which follows, at a predetermined rate, the accumulation vector calculated by the accumulation vector calculation means, by using the acceleration data acquired by the acceleration data acquisition means. The differential vector calculation means calculates, as a differential vector, a difference between the accumulation vector and the following vector. The processing means designates a position in a virtual world displayed by a display device using a value determined in accordance with the differential vector, and performs a predetermined processing by using the position.
According to the first aspect, a value (for example, the respective axial component values of the differential vector or a value obtained by accumulating the differential vector in units of axial component values thereof) determined in accordance with the differential vector is used as a three-dimensional position in the real space relative to a position at which the housing has started to be moved, so as to designate a position in the virtual world. Therefore, it is possible to accurately designate the position by using an output value from an inexpensive acceleration sensor.
According to the second aspect, the respective axial component values of the differential vector are used as the three-dimensional position in the real space relative to a position at which the housing has started to be moved, so as to designate a position in the virtual world. Therefore, it is possible to accurately designate the position by using an output value from an inexpensive acceleration sensor. For example, when a user moves the housing, which has been at rest, in a certain direction and then stops the housing, the differential vector represents this movement and eventually has a value of zero. Therefore, a position obtained by, for example, scaling the respective axial component values of the differential vector in the virtual world so as to designate a coordinate point corresponding to the respective axial component values is moved from the reference position toward the direction in which the housing is moved, and eventually returns to the reference position. In certain example embodiments it is greatly useful for coordinate designation in which a position is moved in the virtual world in accordance with the housing being moved, and returns to the reference position eventually or at certain intervals. Further, a movement of the position designated in the virtual world may be adjusted in accordance with a degree to which the following vector follows the accumulation vector. For example, when the degree to which the following vector follows the accumulation vector is high, the following vector includes a dynamic acceleration component obtained by moving the housing. Therefore, it is difficult to maintain, in the virtual world, the position designated by moving the housing, and a time at which the position returns to the reference position is advanced. On the other hand, when the degree to which the following vector follows the accumulation vector is low, the dynamic acceleration component continues to be included in the accumulation vector for a certain time period after the housing stops. Therefore, the position designated by moving the housing tends to be maintained in the virtual world, and a time at which the position returns to the reference position is delayed.
According to the third and the tenth aspects, when the differential vector is attenuated, an accuracy error of a device such as the acceleration sensor can be alleviated, and when the housing is at rest, the magnitude of the differential vector can securely become almost zero, and the magnitude does not change. Further, when the attenuation of the differential vector is increased, a position is designated in response to a large movement of the housing. On the other hand, when the attenuation of the differential vector is reduced, a position is designated in response to a small movement of the housing. That is, the attenuation rate of the differential vector is adjusted so as to adjust responsiveness to the operation.
According to the fourth aspect, when the magnitude of the differential vector is larger than a predetermined threshold value, the differential vector is used for the predetermined processing performed by the processing means. Therefore, a subtle movement applied to the housing is cancelled, thereby preventing an erroneous determination of the movement of the housing.
According to the fifth and the twelfth aspects, even when the acceleration has a value outside the measurable range of the acceleration sensor, the acceleration can be estimated so as to accurately designate a position.
According to the sixth and the thirteenth aspects, an object is positioned at a position, in the virtual world, designated so as to represent the respective axial component values of the differential vector or a value obtained by accumulating the differential vector in units of the axial component values thereof, and it is possible to realize a game or an information processing for allowing the object to be moved in accordance with the position being moved.
According to the seventh aspect, a position can be designated in the virtual world without limit, thereby realizing an operation with enhanced flexibility.
According to the eighth aspect, when an input device including a plurality of housings is used so as to perform an operation by moving the plurality of housings, it is possible to designate different positions in accordance with each housing being moved, thereby enabling an operation of moving different objects in the virtual world.
According to the ninth aspect, a value obtained by accumulating the differential vector in units of the axial component values thereof is used as a three-dimensional position in the real space relative to a position at which the housing has started to be moved, so as to designate a position in the virtual world. Therefore, it is possible to accurately designate the position by using an output value from an inexpensive acceleration sensor. For example, the value obtained by accumulating the differential vector in units of the axial component values thereof can be also used as a parameter emulating a relative position, in the real space, to which a user moves the housing, thereby allowing designation of a position in the virtual world based on the relative position of the housing.
According to the eleventh aspect, when the magnitude of the differential vector is larger than a predetermined threshold value, the accumulation processing is performed by the accumulation differential value calculation means. Therefore, in the predetermined processing performed by the processing means, a subtle movement applied to the housing is cancelled, thereby preventing an erroneous determination of a movement of the housing.
According to the fourteenth aspect, only while a user presses a predetermined operation button of the housing, the operation is enabled. Even after the user stops pressing the predetermined operation button, the position which has been most recently designated is maintained, and therefore it is easy to designate any position as intended by the user.
Further, the information processing apparatus of certain example embodiments can produce the same effect as that obtained by the storage medium having stored thereon the information processing program described above.
These and other objects, features, aspects and advantages certain example embodiments will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.